class BookmarksController < ApplicationController
  def index
    @pages = Page.all
  end

  def new
    @page = Page.new
    @page.url = "http://"
  end

  def create
    @page = Page.new params.require(:page).permit(:title,:url,:description)
    @page.save
  end

  def show
     @page = Page.find(params[:id])
  end

  def edit
    show
  end

  def update
    show
    @page.update params.require(:page).permit(:title,:url,:description)
  end

  def destroy
     show
    @page.destroy
    redirect_to :action => :index
  end
end
